#ifndef AVALON_MOCKUIDDATASTORE_HPP
#define AVALON_MOCKUIDDATASTORE_HPP
#include "Avalon/UidService/UidDataStore.hpp"
#include "Avalon/UidServiceTests/UidServiceTests.hpp"

namespace Avalon {
namespace UidService {
namespace Tests {

  /*! \class MockUidDataStore
   *  \brief Implements the UidDataStore for testing purposes.
   *  \author Kamal Mansouri <kranar@hotmail.com>
   */
  class MockUidDataStore : public UidDataStore {
    public:

      //! Constructs a MockUidDataStore.
      MockUidDataStore();

      virtual ~MockUidDataStore();

      virtual long long GetNextUid();

      virtual long long Reserve(long long size);

      virtual void Connect();

      virtual bool IsConnected() const;

      virtual void Close();

      virtual boost::signals2::connection ConnectClosedSignal(
        const ClosedSignal::slot_type& slot) const;

      virtual boost::signals2::connection ConnectClosedSignal(
        const ClosedSignal::slot_type& slot, Out<bool> isConnected) const;

    private:
      mutable boost::mutex m_mutex;
      bool m_isConnected;
      long long m_nextUid;
      mutable ClosedSignal m_closedSignal;
  };
}
}
}

#endif // AVALON_MOCKUIDDATASTORE_HPP
